package com.cskaoyan.market.service.wx;/*
 *文件名: WxBrandServiceImpl
 *创建者:wxin
 *创建时间:2024/5/21 9:28
 */

import com.cskaoyan.market.db.domain.MarketBrand;
import com.cskaoyan.market.db.domain.MarketBrandExample;
import com.cskaoyan.market.db.mapper.MarketBrandMapper;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WxBrandServiceImpl implements WxBrandService {
    @Autowired
    MarketBrandMapper brandMapper;
    @Override
    public List<MarketBrand> list(Integer limit, Integer page) {
        PageHelper.startPage(page, limit);
        List<MarketBrand> marketBrands = brandMapper.selectByExample(new MarketBrandExample());
        return marketBrands;
    }

    @Override
    public MarketBrand  detail(Integer id) {
        MarketBrand marketBrand = brandMapper.selectByPrimaryKey(id);
        return marketBrand;
    }

    @Override
    public MarketBrand getById(Integer brandId) {
        return brandMapper.selectByPrimaryKey(brandId);
    }
}
